target=app
CC=g++
CFLAGS=  -Wall -g -I ./include -I /usr/local/libevent/include -I /usr/local/zlib/include
LFLAGS= -L /usr/local/libevent/lib -L /usr/local/zlib/lib   -l event  -l z -lpthread
src=$(wildcard ./src/*.cpp)
obj=$(patsubst %.cpp, %.o, $(src))

$(target):$(obj)
	$(CC) $^ -o $@ $(CFLAGS) $(LFLAGS)

%.o:%.cpp
	$(CC) -c $< -o $@  $(CFLAGS) $(LFLAGS)

.PHONY:clean
clean:
	-rm -rf $(target) -f
	-rm -rf $(obj) -f